import org.junit.jupiter.api.Test
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneId

class LocalDateTimeTest {

    @Test
    fun to_timestamp() {
        val ldt = LocalDateTime.now()
        println(ldt)

        val zdt = ldt.atZone(ZoneId.systemDefault())
        println(zdt)

        val timestamp = zdt.toEpochSecond()
        println(timestamp)

        val timestampMilli = zdt.toInstant().toEpochMilli()
        println(timestampMilli)
    }

    @Test
    fun from_timestamp() {
        val timestamp = System.currentTimeMillis()
        println(timestamp)

        Instant.ofEpochMilli(timestamp)
            .atZone(ZoneId.systemDefault())
    }
}